1 Star 0 Fork 0

intellijboy / ollama4j

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Ollama4j

ollama4j-icon

A Java library (wrapper/binding) for Ollama server.

Find more details on the website.

GitHub stars GitHub forks GitHub watchers GitHub repo size GitHub language count GitHub top language GitHub last commit Hits

codecov

Build Status

Table of Contents

How does it work?

  flowchart LR
    o4j[Ollama4j]
    o[Ollama Server]
    o4j -->|Communicates with| o;
    m[Models]
    subgraph Ollama Deployment
        direction TB
        o -->|Manages| m
    end

Requirements

Java

Or

Installation

In your Maven project, add this dependency:


<dependency>
    <groupId>io.github.amithkoujalgi</groupId>
    <artifactId>ollama4j</artifactId>
    <version>1.0.57</version>
</dependency>

Latest release:

Maven Central

API Spec

Find the full API specifications on the website.

Development

Build:

make build

Run unit tests:

make ut

Run integration tests:

make it

Releases

Releases (newer artifact versions) are done automatically on pushing the code to the main branch through GitHub Actions CI workflow.

Traction

Star History Chart

Areas of improvement

  • Use Java-naming conventions for attributes in the request/response models instead of the snake-case conventions. ( possibly with Jackson-mapper's @JsonProperty)
  • Fix deprecated HTTP client code
  • Setup logging
  • Use lombok
  • Update request body creation with Java objects
  • Async APIs for images
  • Add custom headers to requests
  • Add additional params for ask APIs such as:
    • options: additional model parameters for the Modelfile such as temperature - Supported params.
    • system: system prompt to (overrides what is defined in the Modelfile)
    • template: the full prompt or prompt template (overrides what is defined in the Modelfile)
    • context: the context parameter returned from a previous request, which can be used to keep a short conversational memory
    • stream: Add support for streaming responses from the model
  • Add test cases
  • Handle exceptions better (maybe throw more appropriate exceptions)

Get Involved

Contributions are most welcome! Whether it's reporting a bug, proposing an enhancement, or helping with code - any sort of contribution is much appreciated.

Credits

The nomenclature and the icon have been adopted from the incredible Ollama project.

References

MIT License Copyright (c) 2023 Amith Koujalgi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Java 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/IntelliJBoy/ollama4j.git
git@gitee.com:IntelliJBoy/ollama4j.git
IntelliJBoy
ollama4j
ollama4j
main

搜索帮助